<!DOCTYPE html>
<html>

<head lang="en">
    <title>私信发送</title>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="/js/plugins/bootstrap-4.1.1-dist/css/bootstrap.min.css">
    <script src="/js/plugins/jquery/jquery.min.js"></script>
    <script src="/js/plugins/bootstrap-4.1.1-dist/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="/css/font/css/font-awesome.min.css"/>
    <link rel="stylesheet" href="/css/reset.css"/>
    <link rel="stylesheet" href="/css/news.css"/>
    <script src="/js/plugins/jrender/jrender.min.js"></script>
    <script src="/js/plugins/jrender/jrender.min.js"></script>
    <link rel="stylesheet" href="/js/plugins/dialog2/dialog.css">
    <script src="/js/plugins/dialog2/dialog.min.js"></script>
    <script src="/js/common.js"></script>
    <script>
        $(function () {
            var user = JSON.parse(sessionStorage.getItem("user"));
                var obj = getParams();
            $("#saveSubmit").click(function () {
                var content = $("#texTarea textarea[name='content']").val();
                if(obj){
                    $.post("/privateMessages",{'friend.id':obj.friendId,content:content},function (data) {
                        $.post("/privateMessages",{id:getParams().id,_method:'PUT'})
                        window.location.href="/mine/privateMessage.html?id="+user.id;
                    })
                }
            })
            $("#clianText").click(function () {
                $("#texTarea textarea[name='content']").val('')
            })
        });
    </script>
</head>

<body>

<div class="search-head">
    <div class="row nav-search">
        <div class="col-2">
            <a href="javascript:history.go(-1);">
                <span><i class="fa fa-chevron-left fa-2x"></i></span>
            </a>
        </div>
    </div>
</div>

<input type="hidden" name="currentPage" id="currentPage" value="1">

<div class="container">
    <h4>正在发送私信</h4>
</div>
<div id="texTarea">
    <textarea name="content" class="form-control">
    </textarea>
</div>
<div id="dailyComment">

    <div class="row" style="background:#FFF; color:#FFF">
        <div class="col-6">
            <button class="btn btn-primary dailyCommentBtn" id="saveSubmit">提交</button>
        </div>
        <div class="col-6">
            <button class="btn btn-danger dailyCommentBtn" id="clianText">清空</button>
        </div>
    </div>
</div>

<style>
    #dailyComment {
        position: fixed;
        bottom: 0;
        width: 100%;
    }
    .dailyCommentBtn {
        width: 100%;
        margin:0;
    }
</style>

</body>
</html>